<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="icon" href="./images/NPU.png">
    <title>用户登录</title>
    <style>
        *{box-sizing:border-box;margin:0;padding:0}
        html,body{height:100%;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,"Noto Sans CJK JP","Microsoft YaHei",sans-serif;background:linear-gradient(180deg,#f6f9ff,#eef5ff);color:#111}
        .wrap{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:24px}
        .container{width:100%;max-width:420px;background:#fff;border-radius:12px;box-shadow:0 12px 30px rgba(17,24,39,0.08);padding:28px}
        h1{font-size:26px;margin-bottom:8px}
        form{display:flex;flex-direction:column;gap:12px;margin-top:10px}
        input[type=text],input[type=password]{height:46px;padding:0 14px;border-radius:10px;border:1px solid #e6e9ef;font-size:15px;outline:none}
        input::placeholder{color:#9aa3b2}
        input:focus{box-shadow:0 8px 24px rgba(79,70,229,0.06);border-color:#6b8cff}
        input[type=submit]{height:48px;border-radius:10px;border:0;background:linear-gradient(90deg,#3b82f6,#60a5fa);color:#fff;font-weight:600;cursor:pointer;box-shadow:0 8px 24px rgba(59,130,246,0.18)}
        #regst{margin-top:14px;color:#4b5563;font-size:14px}
        a{color:#2563eb;text-decoration:none;font-weight:600}
        .error{color:#ef4444;margin-top:6px}
        @media (max-width:480px){.container{padding:20px}h1{font-size:20px}}
    </style>
    <script>
        function check(el){try{if(window.check) return window.check(el);}catch(e){}
        }
    </script>
</head>
<body>
<div class="wrap">
    <div class="container">
        <h1>欢迎</h1>
        <c:if test="${requestScope.error =='uname' }"><div class="error">用户名或密码错误</div></c:if>

        <form name="myform" action="Login" method="post">
            <%if(request.getAttribute("return_uri")!=null) {%>
            <input type="hidden" name="return_uri" value="<%=request.getAttribute("return_uri") %>"/>
            <%} %>
            <input name="username" type="text" placeholder="登录名"/>
            <input name="userpass" type="password" placeholder="密码" />
            <input type="submit" value="登录" onclick="check(this)"/>

            <input name="lru" type="hidden"  value="login"/>
            <input name="log" type="hidden" value="log"/>
        </form>
        <div id="regst">
            如果你还没有账户，请点击&nbsp;&nbsp;<a href="regist.jsp">注册</a>
        </div>
    </div>
</div>
</body>
</html>